﻿using System;

namespace GaussianBenchmark
{
    internal class ImmutableGaussianCurve
    {
        private double mean;
        private double variance;
        private double height;

        public double Mean { get { return mean; } }
        public double Variance { get { return variance; } }
        public double Height { get { return height; } }

        public ImmutableGaussianCurve(double Mean, double Variance)
        {
            this.mean = Mean;
            this.variance = Variance;
            this.height = 1;
        }

        public ImmutableGaussianCurve(double Mean, double Variance, double Height)
        {
            this.mean = Mean;
            this.variance = Variance;
            this.height = Height;
        }

        public double Density(double X)
        {
            double difference = X - mean;
            double exponent = (-1 * difference * difference / (2 * variance));
            return height * Math.Pow(Math.E, exponent);
        }

        public override string ToString()
        {
            return "Mean: " + Mean.ToString() + " Variance: " + Variance.ToString();
        }
    }
}
